package com.atguigu.gulimall.member.web;
import com.atguigu.common.utils.R;
import com.atguigu.common.xss.HTMLFilter;
import com.atguigu.gulimall.member.feign.OrderFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.web.HateoasPageableHandlerMethodArgumentResolver;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
@Controller
public class MemberWebController {
    @Autowired
    private OrderFeignService orderFeignService;
    @GetMapping("/memberOrder.html")
    public String memberOrderPage(@RequestParam(value = "pageNum",defaultValue = "1") Integer   pageNum,
                                  Model model, HttpServletRequest request){
        //  获取到支付宝  给我们传来的  所有请求数据
        HashMap<String, Object> page = new HashMap<>();
        page.put("page",pageNum.toString());
        R r = orderFeignService.listWithItem(page);
        model.addAttribute("orders",r);
        // 查出当前用户 的所有订单列表数据
        return  "orderList";
    }
}
